<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>

        var list = ['zs', 'ls', 'wu', 'zl']

        function getName() {
            if (list.length==0) alert("OMG!")
            var randIndex = Math.floor(Math.random()*list.length);
            var divName = document.getElementById('div1');
            divName.replaceChild(document.createTextNode(list[randIndex]), divName.childNodes[0])
            list.splice(randIndex)
        }
    </script>
</head>
<body>
<div id="div1">sssss</div>
<div>
    <button onclick="getName()" >randStu</button>
</div>
</body>
</html>